﻿{tpl head}
<script charset="utf-8" src="../kedit/kindeditor-min.js"></script>
<script type="text/javascript">
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {uploadJson: '?c=upload&yeslitpic=1'});
		//给按钮添加click事件
		K('#faddim').click(function() {
			editor.loadPlugin('image', function() {
				//图片弹窗的基本参数配置
				editor.plugin.imageDialog({
					showRemote: false, //网络图片不开启
					imageUrl: K('#img').val(), //如果图片路径框内有内容直接赋值于弹出框的图片地址文本框
					//点击弹窗内”确定“按钮所执行的逻辑
					clickFn: function(url, title, width, height, border, align) {
						K('#img').val(url);//获取图片地址
						editor.hideDialog(); //隐藏弹窗
						document.k_form.flagsp.checked=true;
					}
				});
			});
		});
	});
</script>
<form method="Post" name="k_form" action="?c=article&a=add_do">
    <table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
		<thead>
			<tr class="n_bt"><td colspan="2" align="center">管理系统</td></tr>
			<tr><th height="28" colspan="2" class="thbt">【添加文章】</th></tr>
		</thead>
		<tbody>
			<tr>
				<td height="30" align="right">所属分类：</td>
				<td><select name="fid" class="input400 selecth" id="fid">
						<option value="0" selected="selected" class="red">请选择栏目</option>
						{$option_list}
					</select> <span class="red">*</span></td>
			</tr>
			<tr>
				<td width="13%" height="30" align="right">文章标题：</td>
				<td width="87%"><input name="title" type="text" id="title" class="input400" value="{$oj.title}"  onfocus="kcancel('title')"/></td>
			</tr>
			<tr>
				<td width="13%" height="30" align="right"><p>短标题：</p></td>
				<td width="87%"><input name="shorttitle" type="text" class="input400" value="{$oj.shorttitle}"  /></td>
			</tr>
			<tr>
				<td height="30" align="right">作者：</td>
				<td><input name="writer" type="text" value="{if $form_action=='add_do'}管理员{else}{$oj.writer}{/if}" class="input400" /></td>
			</tr>
			<tr>
				<td height="30" align="right">TAG：</td>
				<td><input name="tag" type="text" value="{$oj.tag}" class="input400" /></td>
			</tr>
			<tr>
				<td height="30" align="right">关键词：</td>
				<td><input name="keywords" type="text" value="{$oj.keywords}" class="input400" /></td>
			</tr>
			<tr>
				<td height="30" align="right">说明：</td>
				<td class="pb5"><textarea name="description" class="input400 textareah">{$oj.description}</textarea></td>
			</tr>
			<tr>
				<td height="30" align="right">正文：</td>
				<td class="pb5">
					<!--<input name="remote" type="checkbox" class="np" id="remote" value="1" checked="1">
					 下载远程图片和资源
					<input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" checked="1"> 
					提取第一个图片为缩略图<br>-->
					<textarea name="content" cols="95" rows="20" >{$oj.con}</textarea></td>
			</tr>
			<tr>
				<td align="right">上传缩略图：</td>
				<td>
					<input name="img" type="text" id="img" class="input400" value="{$oj.litpic}" />
					<span id="faddim" class="button">上传图片</span>
					<span id="list_img"></span>
				</td>
			</tr>
			<tr>
				<td height="30" align="right">属性：</td>
				<td>&nbsp;
					<input id="flagsh" value="h" type="checkbox" name="flags[]"{if strpos($oj.flag,'h')} checked="checked" {/if}/>
						   头条[h]
						   <input id="flagsc" value="c" type="checkbox" name="flags[]" {if strpos($oj.flag,'c')} checked="checked" {/if}/>
						   推荐[c]
						   <input id="flagsf" value="f" type="checkbox" name="flags[]" {if strpos($oj.flag,'f')} checked="checked" {/if}/>
						   幻灯[f]
						   <input id="flagsa" value="a" type="checkbox" name="flags[]" {if strpos($oj.flag,'a')} checked="checked" {/if}/>
						   特荐[a]
						   <input id="flagss" value="s" type="checkbox" name="flags[]" {if strpos($oj.flag,'s')} checked="checked" {/if}/>
						   滚动[s]
						   <input id="flagsb" value="b" type="checkbox" name="flags[]" {if strpos($oj.flag,'b')} checked="checked" {/if}/>
						   加粗[b]
						   <input id="flagsp" value="p" type="checkbox" name="flags[]" {if strpos($oj.flag,'p')} checked="checked" {/if}/>
						   图片[p]
						   <input id="flagsj" onclick="ShowUrlTr()" value="j" type="checkbox" name="flags[]" {if strpos($oj.flag,'j')} checked="checked" {/if}/>
						   跳转[j]
						   <input id="isAccept" value="1"{if $oj.ischeck || $form_action=='add_do'} checked="checked"{/if} type="checkbox" name="ischeck" />立即发布（否则审核后才能发布。） </td>
			</tr>
			<tr>
				<td align="right">日期：</td>
				<td>
					<input name="startdate" type="text" id="startdate" class="input400" value="{if $form_action=='add_do'}{$startdate}{else}{function=date("Y-m-d H:i:s",$oj.startdate)}{/if}" />			
				</td>
			</tr>
			<tr>
				<td height="35" colspan="2" align="center" ><input name="into_wz" id="submit" class="button" type="submit" value="{$submit}" />
					&nbsp;<input name="" type="reset" class="button" value="重置" />
					<input name="id" type="hidden" value="{$oj.id}" />
					<input name="oldtag" type="hidden" value="{$oj.tag}" />
					<input type="hidden" name="a" value="{$form_action}" />
				</td>
			</tr></tbody>
    </table>
</form>